import React,{Component} from "react";
import "./mine.css"
import MinHeader from './minhead'
import Nav from './nav'
import List from './list'
import TagList from './taglist'
import TagList1 from "./taglist_1"

import {getLoginStatus,getUserInfo,getLoginRefresh} from "../../api/index"

class Mine extends Component {
    constructor(){
        super();
        // console.log(this)
        this.state={
            userInfo:[]
        }
    }
    componentDidMount(){
        
        getLoginStatus().then(res=>{
            // if(res.status==301){
            //     this.props.history.push("/login")
            // }
            console.log(res)
            this.setState({
                id:res.data.profile.userId
            })
            getUserInfo(res.data.profile.userId).then(res=>{
                console.log(res.data.profile)
                this.setState({
                    userInfo:res.data.profile
                })
            })
        })
      

    }
    render(){
        return(
            // <div>123</div>
            <div className="Mine" id="mine">
                  
                  <Nav userInfo={this.state.userInfo}></Nav>
                  <List></List>
                  <div className="lin"></div>
                  <TagList></TagList>
                  <div className="lin"></div>
                  <TagList1></TagList1>
            </div>
        )
    }
}

export default Mine